# Maintainer: Alexey Pavlov <alexpux@gmail.com>

pkgname=dash
pkgver=0.5.10.2
pkgrel=1
pkgdesc="A POSIX compliant shell that aims to be as small as possible"
arch=('i686' 'x86_64')
url="http://gondor.apana.org.au/~herbert/dash/"
license=('BSD')
depends=('msys2-base' 'msys2-runtime' 'grep' 'sed')
groups=('base')
install=dash.install
source=("http://gondor.apana.org.au/~herbert/dash/files/${pkgname}-${pkgver}.tar.gz")
sha256sums=('3c663919dc5c66ec991da14c7cf7e0be8ad00f3db73986a987c118862b5f6071')

build() {
  cd "${srcdir}/${pkgname}-${pkgver}"
  ./configure --prefix=/usr \
      --bindir=/usr/bin \
      --mandir=/usr/share/man \
      --exec-prefix="" \
      CFLAGS='-O2 -static-libgcc'
  make
}

package() {
  cd "${srcdir}/${pkgname}-${pkgver}"
  make DESTDIR="${pkgdir}" install

  # license
  install -m644 -D COPYING ${pkgdir}/usr/share/licenses/${pkgname}/COPYING

  ln -s ${pkgdir}/usr/bin/{d,}ash.exe
  ln -s ${pkgdir}/usr/share/man/man1/{d,}ash.1
}
